package com.wardrobe.dao.store;

import com.wardrobe.domain.common.BackEndFromBean;
import com.wardrobe.domain.store.StoreBean;
import com.wardrobe.domain.store.StoreShowBean;
import com.wardrobe.mapper.master.store.StoreMasterMapper;
import com.wardrobe.mapper.slave.store.StoreSlaveMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2018/11/16.
 */
@Service
public class StoreDao {
    @Autowired
    private StoreMasterMapper storeMasterMapper;
    @Autowired
    private StoreSlaveMapper storeSlaveMapper;

    public int insertStore(StoreBean storeBean){
       return storeMasterMapper.insertStore(storeBean);
    }

    public int updateStore(BackEndFromBean fromBean){
       return storeMasterMapper.updateStore(fromBean);
    }

    public List<StoreShowBean> selectStoreBookingList(long userId){
        return storeSlaveMapper.selectStoreBookingList(userId);
    }

    public List<StoreShowBean> selectStoreGoodsList(long userId){
        return storeSlaveMapper.selectStoreGoodsList(userId);
    }

    public StoreShowBean selectStoreGoods(long userId,  long id){
        return storeSlaveMapper.selectStoreGoods(userId,id);
    }

    public StoreShowBean selectCancelStoreGoods(long userId,long id){
        return storeSlaveMapper.selectCancelStoreGoods(userId,id);
    }

    public StoreShowBean selectStoreBooking(long userId,long id){
        return storeSlaveMapper.selectStoreBooking(userId,id);
    }

    public StoreShowBean selectCancelStoreBooking(long userId,long id){
        return storeSlaveMapper.selectCancelStoreBooking(userId,id);
    }
}
